﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Data.SqlClient;
using Net7Music_Api.Model;


namespace Net7Music_Api.DAL
{
    public class SingerServces
    {
        public static List<Singer> Singers()
        {
            string sql = "select * from Singer";
            SqlDataReader dr = DBHelper.GetDataReader(sql);
            List<Singer> getSinger = new();
            while (dr.Read())
            {
                Singer Singer = new()
                {
                    SingerID = dr.GetInt32(0),
                    Name = dr.GetString(1),
                    Alias = dr.GetString(2),
                    Artistpicture = dr.GetString(3),
                    Artistheaderimage = dr.GetString(4),
                    Gender = dr.GetString(5),
                    Birthday = dr.GetDateTime(6),
                    AreaID = dr.GetInt32(7),
                    OwnedCompany = dr.GetString(8),
                    Artistprofile = dr.GetString(9),
                    ActualName = dr.GetString(10),
                    Phone = dr.GetString(11),
                    Email = dr.GetString(12),
                    Country = dr.GetString(13),
                    Identification = dr.GetString(14),
                    Detailed = dr.GetString(15),
                    Status = dr.GetInt32(16),

                };
                getSinger.Add(Singer);
            }
            dr.Close();
            return getSinger;
        }
    }
}
